/*
 * @Author: @yzcheng
 * @Date: 2021-03-05 14:31:13
 * @Version: 1.0
 * @LastEditors: @yzcheng
 * @Description:
 * @LastEditTime: 2021-03-05 15:00:09
 */
import { ElMessage } from 'element-plus'
const myMixin = {
  methods: {
    _info(rst, msg = null) {
      if (rst === 200) {
        ElMessage.success({
          message: this.$t('messages.success', msg?.success),
          // message: this.$t('操作成功', msg?.success),
          type: 'success',
        })
      }
      if (rst !== 200) {
        ElMessage.error(this.$t('messages.error', msg?.error))
        // ElMessage.error(this.$t('操作失败', msg?.error))
      }
      if (!rst) {
        ElMessage.error(this.$t('messages.requestFailed'))
        // ElMessage.error(this.$t('请求失败'))
      }
    },
  },
}
export default myMixin
